{% extends "counterpoint/forum_base.html" %}

{% block title %}{{ forum }} - {{ block.super }}{% endblock %}

{% block breadcrumbs %}{{ block.super }} &raquo; {{ forum }}{% endblock %}
{% block breadcrumbs2 %}{{ block.super }} &raquo; {{ forum }}{% endblock %}

{% block description %}{{ forum.description|linebreaks }}{% endblock %}

{% block nexturl %}{{ forum.get_absolute_url }}{% endblock %}

{% block buttons %}
<td><a title="Post a new topic" class="button" href="{{ forum.new_topic_url }}">New Topic</a></td>
{% endblock %}

{% block buttons2 %}
<td><!-- <a class="button" href="{{ forum.new_topic_url }}">New Topic</a> --></td>
{% endblock %}

{% block content %}
        <table>
          <tr class="tableheader">
            <th>&nbsp;</th>
            <th>Topic</th>
            <th class="center">Author</th>
            <th class="center">Replies</th>
            <th class="center">Views</th>
            <th>Last Post</th>
          </tr>
  {% if object_list %}
    {% for thread in object_list %}
          <tr class="{% cycle row1,row2 as rowcolors %}">
            <td class="thread_icon">
              {# <img title="{% unread_thread_status %}" alt="" class="{% unread_thread_status %}_img" src="{{ MEDIA_URL }}images/{% if thread.locked %}locked{% else %}blank{% endif %}.gif" /> #}
            </td>
            <td class="thread_title">
              {% if thread.sticky %}<img title="Sticky Topic" alt="" src="{{ MEDIA_URL }}images/sticky.gif" /><a class="sticky"{% else %}<a{% endif %} href="{{ thread.get_absolute_url }}">{{ thread.title_escaped }}</a>
              {# {% ifnotequal thread.page_count 1 %}Page{% for page in thread.pages %} <a href="{{ thread.get_absolute_url }}{% ifnotequal page 1 %}p/{{ page }}/{% endifnotequal %}">{{ page }}</a>{% endfor %}{% endifnotequal %} #}
            </td>
            <td class="thread_author">
              <a class="{{ thread.author.get_access_display }}" href="{{ thread.author.get_absolute_url }}">{{ thread.author }}</a>
            </td>
            <td class="thread_replies">{{ thread.reply_count }}</td>
            <td class="thread_views">{{ thread.views }}</td>
            <td class="last_post">
            {% if thread.last_reply %}
              {{ thread.last_reply.posted|date:"F j, Y \a\t H:i" }} <a href="{{ thread.last_reply.get_absolute_url }}">by {{ thread.last_reply.author }}</a>
            {% else %}
              {{ thread.posted|date:"F j, Y \a\t H:i" }}
            {% endif %}
            </td>
          </tr>
    {% endfor %}
  {% else %}
          <tr class="row1">
            <td colspan="6" class="no_items">No threads yet.</td>
          </tr>
  {% endif %}
        </table>
{% endblock %}
